home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / evterm.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  678 b   |  33 lines

  1.       subroutine evterm(val,arg,iexp)
  2.       implicit double precision (a-h,o-z)
  3. c
  4. c     this routine evaluates one term of a polynomial.
  5. c
  6.       jexp=iexp+1
  7.       if (jexp.ge.6) go to 60
  8.       go to (10,20,30,40,50), jexp
  9.    10 val=1.0d0
  10.       go to 100
  11.    20 val=arg
  12.       go to 100
  13.    30 val=arg*arg
  14.       go to 100
  15.    40 val=arg*arg*arg
  16.       go to 100
  17.    50 val=arg*arg
  18.       val=val*val
  19.       go to 100
  20.    60 if (arg.eq.0.0d0) go to 70
  21.       argexp=dble(iexp)*dlog(dabs(arg))
  22.       if (argexp.lt.-200.0d0) go to 70
  23.       val=dexp(argexp)
  24.       if((iexp/2)*2.eq.iexp) go to 100
  25.       val=dsign(val,arg)
  26.       go to 100
  27.    70 val=0.0d0
  28. c
  29. c  finished
  30. c
  31.   100 return
  32.       end
  33.